<?php
/* SVN FILE: $Id: default.ctp 7945 2008-12-19 02:16:01Z gwoo $ */
/**
 *
 * PHP versions 4 and 5
 *
 * CakePHP(tm) :  Rapid Development Framework (http://www.cakephp.org)
 * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
 *
 * Licensed under The MIT License
 * Redistributions of files must retain the above copyright notice.
 *
 * @filesource
 * @copyright     Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
 * @link          http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project
 * @package       cake
 * @subpackage    cake.cake.libs.view.templates.layouts
 * @since         CakePHP(tm) v 0.10.0.1076
 * @version       $Revision: 7945 $
 * @modifiedby    $LastChangedBy: gwoo $
 * @lastmodified  $Date: 2008-12-18 18:16:01 -0800 (Thu, 18 Dec 2008) $
 * @license       http://www.opensource.org/licenses/mit-license.php The MIT License
 */
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<?php echo $html->charset(); ?>
	<title>
		<?php __('Softech CRM ->');?>
		<?php echo $title_for_layout; ?>
	</title>
	<?php
		echo $html->meta('icon');

		echo $html->css('cake.generic');
		echo $html->css('tablesorter');
		echo $html->css('SimplejQueryDropdowns/style.css');
		echo $html->css('themes/base/ui.all.css');		
		echo $javascript->link('jquery-1.3.2.min.js');
		echo $javascript->link('jquery.dropdownPlain.js');
		echo $javascript->link('jquery.tablesorter.min.js');
		echo $javascript->link('ui/ui.core.js');
		echo $javascript->link('ui/ui.datepicker.js');
		echo $scripts_for_layout;
	?>
	<script type="text/javascript">
<?php 	if ($this->action == 'index') {?>
			var controlName = '<?=strtolower($this->name)?>';
			var curpage = <?=$curpage?>;
			var perpage = <?=$perpage?>;
<?php 	} ?>
		$(document).ready(function() {
<?php 	if ($this->action == 'index') {?>
			// Xử lý khi click vào nút chọn số dòng hiển thị trên 1 trang
			$("span.num").click(function() 
			{
				window.location.href = '/'+ controlName +'/index/1/' + this.id.substr(4);
			});
			// Xử lý khi click vào nút xóa danh mục
			$("#btndelete").click(function()
			{
				var id_delete = "";
				$("td > .chkItems > input:checkbox").each(function() 
				{ 
					if (this.checked)
					{
						if (id_delete == "")
						{
							id_delete = this.id.substr(4);
						}
						else
						{
							id_delete = id_delete + "," + this.id.substr(4);
						}
					}
				});
				if (id_delete.length > 0) {
					ok = confirm('Bạn chắc chắn muốn xóa các chuyên mục đã được chọn');
					if (ok) {
						window.location.href = '/<?=strtolower($this->name)?>/delete/' + id_delete;
					}
				} else {
					alert("Bạn chưa chọn mục nào để xóa");
				}
		    });
			// Chọn tất cả
			$("#btnSelectAll").click(function() 
			{
				$("td > .chkItems > input:checkbox").each(function() 
				{ 
					this.checked = true; 
				}); 
		    });
			// Hủy chọn tất cả
			$("#btnUnSelectAll").click(function()
			{
				$("td > .chkItems > input:checkbox").each(function() 
				{ 
					this.checked = false; 
				}); 
		    });	
			// Đảo chọn
			$("#btnDisSelect").click(function() 
			{
				$("td > .chkItems > input:checkbox").each(function() 
				{ 
					this.checked = !this.checked;
				}); 
		    });
			// Di chuyển đến trang
			$("span.paging").click(function() 
			{
				var page = this.id.substr(5);
				
				if (page !="" && page !=curpage)
					window.location.href='/' + controlName + '/index/' + page + '/' + perpage;
		    });
			// Click vào nut hinh anh di chuyen trang (first/pre/next/last)
			$("img.paging").click(function() 
			{
				var page = this.id.substr(5);
				if (page !="")
					window.location.href='/' + controlName + '/index/' + page + '/' + perpage;
		    });	
	    	$("#tableEmployees").tablesorter({headers: { 2: {sorter: false}, 4: {sorter: false}, 5: {sorter: false} , 6: {sorter: false}, 7: {sorter: false}, 8: {sorter: false}, 9: {sorter: false}}, widgets: ['zebra'] });
<?php 	} else { ?>
			$("#EmployeeBirthday").datepicker({dateFormat: 'dd/mm/yy',showOn: 'button', buttonImage: '/img/calendar.gif', buttonImageOnly: true});
<?php 	} ?>
		});
	</script>
	<!--[if lte IE 7]>
		<link rel="stylesheet" type="text/css" href="css/SimplejQueryDropdowns/ie.css" media="screen" />
    <![endif]-->
	<style type="text/css">    
	    div.quicksearch 
	    {              
	      padding-bottom: 10px;
	    }
		img.editIterm
		{
			cursor: pointer;
		}
/*
		img.deleteIterm
		{
			cursor: pointer;
		}
*/		
	</style>
</head>
<body>
	<div id="container">
		<div id="header">
			<div class="menuheader" style="width: 100%;">
				<ul class="dropdown">
					<li>
						<a href="#">Hệ thống</a>
						<ul class="sub_menu">
							<li><a href="/employees/">Nhân sự</a></li>
							<li><a href="/users/">Người dùng</a></li>
							<li><a href="/users/profile">Thông tin cá nhân</a></li>
							<li><a href="/users/logout">Logout</a></li>
						</ul>
					</li>
					<li><a href="#">Doanh nghiệp</a>
						<ul class="sub_menu">
							<li><a href="#">Danh sách</a></li>
						</ul>
					</li>
					<li>
						<a href="#">Hợp đồng</a>
						<ul class="sub_menu">
							<li><a href="#">Danh sách</a></li>
						</ul>
					</li>
				</ul>
			</div>
		</div>
		<div id="content">
			<div style="padding-left: 135px"><?php $session->flash(); ?></div>
			<?php echo $content_for_layout; ?>
		</div>
		<div id="footer">
			<?php 
/*			
				echo $html->link(
					$html->image('cake.power.gif', array('alt'=> __("CakePHP: the rapid development php framework", true), 'border'=>"0")),
					'http://www.cakephp.org/',
					array('target'=>'_blank'), null, false
				);
*/				
			?>
		</div>
	</div>
	<?php echo $cakeDebug; ?>
</body>
</html>